home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
10,000 Great Games
/
10,000 Great Games.iso
/
Product
/
66
/
data1.cab
/
Source_Files
/
Src
/
Effect.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2000-01-16
|
807b
|
40 lines
#include "stdafx.h"
cEffect *effects = 0;
cEffect::cEffect(int _x, int _y, cProperties *_orig, char *sequence, int stay)
: cGameObject(_orig)
{
add((cList **)&effects);
set_sequence(sequence, FALSE);
set_position(_x, _y);
make_dirty();
set_soundsequence(sequence, FALSE);
stay_on_screen = stay;
}
int cEffect::control()
{
cGameObject::control();
if (animation_done())
set_image(0);
else if (stay_on_screen && y2 < surface->start)
set_position(x, y + surface->start - y2);
return (!sound_done() || !animation_done()) && (stay_on_screen || y_on_screen());
}
void cEffect::make(int x, int y, cProperties *orig, char *sequence, int n, int dx, int dy)
{
for (; n > 0; n--)
new cEffect(x + pmrnd(dx), y + pmrnd(dy), orig, sequence);
}